-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Load checkout scripts when they are not previously loaded on checkout page #9984
Load checkout scripts when they are not previously loaded on checkout page #9984
Conversation
Test the buildOption 1. Jetpack Beta
Option 2. Jurassic Ninja - available for logged-in A12s🚀 Launch a JN site with this branch 🚀 ℹ️ Install this Tampermonkey script to get more options. Build info:
Note: the build is updated when a new commit is pushed to this PR. |
Size Change: 0 B Total Size: 1.39 MB ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Tested according to the instructions and card form appeared as expected with the branch changes.
Fixes #4219
Changes Proposed in This Pull Request
This PR introduces an additional hook executed on the checkout form to ensure checkout scripts are loaded if they haven't been enqueued. These scripts are typically added within the payment fields. If the fields are not rendered, or this function isn't invoked during a standard (non-AJAX) request, the scripts fail to load, causing issues like the one described in the linked issue.
Testing Instructions
Switch to the
develop
branch.Ensure you have at least two shipping methods enabled.
Add the following filter to your code (e.g., inside
functions.php
). Note that checking out to thedevelop
branch might overwrite this change, so ensure the filter is re-added if needed. Adjust the shipping method name in the example (local_pickup
) to match one you have configured. This filter removes WooCommerce Payments as a gateway for the specified shipping method:Test behavior on the
develop
branch:develop
branch might overwrite it.local_pickup
). Confirm that WooCommerce Payments is not available as a payment option.Switch to this branch and repeat the test:
npm run changelog
to add a changelog file, choosepatch
to leave it empty if the change is not significant. You can add multiple changelog files in one PR by running this command a few times.Post merge